﻿using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using LightWeightORM.ORM;
using LightWeightORM.ORM.MappingAttribute;

namespace SmartWarehouse
{
    namespace ORM
    {
        namespace Entity
        {

            /// <summary>
            /// Summary description for User
            /// </summary>
            [TableMapping("Sw_User","name")]
            public class SwUser
            {
                public SwUser()
                {
                }

                #region Constant Fileds Name

                public const string _Name = "name";
                public const string _Password = "password";
                public const string _Mail = "mail";
                public const string _Phone = "phone";
                public const string _Address = "address";
                public const string _Role = "role";
                public const string _Status = "status";

                #endregion


                #region Fields

                private string m_name;
                private string m_password;
                private string m_mail;
                private string m_phone;
                private string m_address;
                private string m_role;
                private string m_status;

                #endregion

                #region Properties

                [DataField("name", "nvarchar(50)")]
                public string Name
                {
                    get { return m_name; }
                    set { m_name = value; }
                }

                [DataField("password", "nvarchar(50)")]
                public string Password
                {
                    get { return m_password; }
                    set { m_password = value; }
                }

                [DataField("mail", "nvarchar(50)")]
                public string Mail
                {
                    get { return m_mail; }
                    set { m_mail = value; }
                }

                [DataField("phone", "nvarchar(50)")]
                public string Phone
                {
                    get { return m_phone; }
                    set { m_phone = value; }
                }

                [DataField("address", "nvarchar(200)")]
                public string Address
                {
                    get { return m_address; }
                    set { m_address = value; }
                }

                [DataField("role", "nvarchar(50)")]
                public string Role
                {
                    get { return m_role; }
                    set { m_role = value; }
                }

                [DataField("status", "nvarchar(1)")]
                public string Status
                {
                    get { return m_status; }
                    set { m_status = value; }
                }
                #endregion
            }

            public class UserStatus
            {
                //A：激活，U:未激活，L：锁定，D：删除
                public const string Active = "A";
                public const string Unactive = "U";
                public const string Locked = "L";
                public const string Deleted = "D";
            }
        }
    }
}